#ifndef _OBJECT_H_
#define _OBJECT_H_

#include "Sprite.h"
#include "Camera.h"
#include "SweptAABB.h"
#include <list>


using namespace std;
class Object
{
public:
	CSprite* sprite;
	//posX, posY -> toa do center
	int posX;
	int posY;
	int width;
	int height;
	float vX;
	float vY;
	EnumID id;
	bool canMove;
	CTexture *m_pSprite; // object'sprite
	D3DXVECTOR2 m_position; // object' position
	D3DXVECTOR2 m_velocity; //van toc


	virtual void Update(int deltaTime);
	virtual void Draw(CCamera*);
	virtual void DrawBound(CCamera*);
	virtual void ProcessInput(LPDIRECT3DDEVICE9 d3ddv, int t);
	virtual void UpdateAction(Action action);
	virtual void OnKeyDown(int KeyCode);
	virtual void Collision(list<Object*> obj, float dt);
	virtual int CheckCollision(Object* ,float, float&); //Kiem tra va tra ve huong va cham voi other object va thoi gian va cham	

	virtual Box GetBox();

	Object(void);
	Object(int posX, int posY, float vX, float vY, EnumID id);
	~Object(void);

protected:	
	void CreateSprite();
};

#endif
